package com.jiaoyou.baojian.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiaoyou.baojian.R;
import com.jiaoyou.baojian.entity.UserInfo;
import com.jiaoyou.baojian.utils.GlideCircleTransform;
import com.jiaoyou.baojian.utils.Utils;

/**
 * Created by DemonZYM on 17/4/13.
 */

public class ShengyouAdapter extends BaseQuickAdapter<UserInfo, BaseViewHolder> {
    public ShengyouAdapter() {
        super(R.layout.item_shengyou);
    }

    @Override
    protected void convert(BaseViewHolder helper, UserInfo item) {
        helper.setText(R.id.name, item.nickname + "，" + Utils.getAge(item.birthday));
        Glide.with(mContext).load(Utils.getImageUrl(mContext, item.avatar))
                .crossFade()
                .transform(new GlideCircleTransform(mContext)).into((ImageView) helper.getView(R.id.header));
    }
}
